package ezXpns.analysis.aggregators;

import java.util.UUID;

import ezXpns.analysis.Aggregator;


//@author A0088827L
public class Sum implements Aggregator<Float, Float> {
	public Sum() {
		this(0.f);
	}
	
	public Sum(float initial) {
		acc = initial;
	}

	@Override
	public void addEntry(UUID id, Float item) {
		acc += item;
	}

	@Override
	public void removeEntry(UUID id, Float item) {
		acc -= item;
	}

	@Override
	public Float getResult() {
		return acc;
	}

	private float acc;
}
